package models

const (
	ZH_CN = "zh-CN"
	EN_US = "en-US"
)

/*bind state*/
const (
	UNKNOWNSTATE = -1
	UNBIND       = iota
	USERSTUB
	//BINDING
	BINDED
	DEVSTUB
)

/*device status*/
const (
	ONLINE = 1
	OFFLINE = 0
)

/*push*/
const (
	NOTIFY_CALL           = 1
	NOTIFY_REMAINDER      = 2
	NOTIFY_COMPLETEORDER  = 3
	NOTIFY_BIND           = 4
	NOTIFY_DEVUP          = 5
	NOTIFY_DEVDOWN        = 6
	NOTIFY_SHORTAGE       = 7
	NOTIFY_POSTMANONLINE  = 8
	NOTIFY_POSTMANOFFLINE = 9
)

/*call state*/
const (
	CALL = iota
	REMINDER
)

/*order state*/
const (
	NEW      = 1
	ACCECPT  = 2
	COMPLETE = 4
)

/*order process type*/
const (
	MAKEPHONE = iota + 1
	SMS
	NOTICE
	SELF
)

/*error code*/
const (
	SUCCESS = iota
	InternalError
	ParseError
	UcFailed
	ValidateError
	UnknownError

	MediaExists
	UserNameExists
	UnknownMedia
	RetryLater
	InvalidCaptcha

	Unbind
	AlredyBinded
	AlredyBindedByOthers
	Binding
	BindFailed
	InvalidDev

	Dev_InvalidDev   = 401
	Dev_ParseError   = 402
	Dev_AlredyBinded = 403
	Dev_Binding      = 404
	Dev_Unbind       = 405
	Dev_ToBind       = 406
)

var ErrMap map[string]map[int]string = map[string]map[int]string{
	ZH_CN: map[int]string{
		InternalError:        "服务器内部错误",
		ParseError:           "参数解析失败",
		ValidateError:        "验证失败,请重新登录",
		UnknownError:         "未知错误",
		MediaExists:          "号码已经被注册",
		UserNameExists:       "用户名被注册过",
		UnknownMedia:         "号码类型不正确",
		RetryLater:           "请稍后再试",
		InvalidCaptcha:       "验证码无效",
		AlredyBinded:         "设备已经绑定过",
		AlredyBindedByOthers: "设备被别人绑定",
		InvalidDev:           "不是有效的设备",
		Binding:              "设备正在等待绑定",
		BindFailed:           "绑定失效",
		Unbind:               "设备还未绑定",
		Dev_InvalidDev:       "401",
		Dev_ParseError:       "402",
		Dev_AlredyBinded:     "403",
		Dev_Binding:          "404",
		Dev_Unbind:           "405",
	},
	EN_US: map[int]string{
		InternalError:        "internal error",
		ParseError:           "parse Error",
		ValidateError:        "validate error",
		UnknownError:         "unknown error",
		MediaExists:          "media exists",
		UserNameExists:       "userName exists",
		UnknownMedia:         "unknown media",
		RetryLater:           "retry later",
		InvalidCaptcha:       "invalid captcha",
		AlredyBinded:         "alredy binded",
		AlredyBindedByOthers: "binded by others",
		InvalidDev:           "invalid device",
		Binding:              "binding",
		BindFailed:           "bind failed",
		Unbind:               "unbind",
		Dev_InvalidDev:       "401",
		Dev_ParseError:       "402",
		Dev_AlredyBinded:     "403",
		Dev_Binding:          "404",
		Dev_Unbind:           "405",
	},
}
